/**
 * 
 */
package javacommon.util;

import java.io.IOException;
import java.util.Properties;

/**
 * @author Administrator
 *
 */
public class PropertiesUtils {

	public static Properties config=new Properties();
	
	private static PropertiesUtils instance=null;
	public static PropertiesUtils getInstance(){
		if(instance==null)
		{
			instance = new PropertiesUtils();
		}
		return instance;
	}
	
	private PropertiesUtils(){
		try {
			config.load(PropertiesUtils.class.getClassLoader().getResourceAsStream("configData.properties"));
		} catch (IOException e) {
			e.printStackTrace();
		}
	}
	
	public String get(String key){
		return config.getProperty(key);
	}
	/**
	 * @param args
	 */
	public static void main(String[] args) {
		System.out.println(PropertiesUtils.class.getClassLoader().getResource("configData.properties").getFile());

	}

}
